package com.taoist_awei.blog.exception;

import com.taoist_awei.blog.core.HttpResult;
import org.springframework.validation.BindingResult;

/**
 * @author 高威
 * 用于处理客户端非法请求的异常
 */
public class InvalidRequestException extends ApiException {
    public InvalidRequestException(HttpResult result) {
        super(result);
    }

    public InvalidRequestException(BindingResult bindingResult) {
        super();
        HttpResult result = new HttpResult.HttpResultBuilder()
                .statusCode(400)
                .bindingResult(bindingResult)
                .message("参数错误")
                .build();
        super.setResult(result);
    }
}